{% extends "base.html" %}

{% block content %}
{% if error_message %}<p class="error">{{ error_message }}</p>{% endif %}
{% if create %}<h3><a href="/ideas/{{ create }}">Go/Create Idea: {{ create }}</a></h3>{% endif %}

{% if ideas %}
<h1>Results for Ideas</h1>
<p><a onclick="switchMenu('resultslist-wrap');">Show Ideas</a></p>
<div id="resultslist-wrap">
	<ol>
{% for idea in ideas %}

	<li>
		<dl>
		<dt><a href="/ideas/{{ idea.title }}">{{ idea.title }}</a> by {{ idea.author }}</dt>
		<dd class="tags">Tags: {{ idea.tags }}</dd>
		<dd class="date">Published : {{ idea.pub_date }}</dd>
		<dd class="date">Modified : {{ idea.change_date }}</dd>
		</dl>
	</li>
{% endfor %}
	</ol>
</div>
{% endif %}

{% if tags %}
<h1>Results for Tags</h1>
<p><a onclick="switchMenu('resultslist-wrap1');">Show Tags</a></p>
<div id="resultslist-wrap1">
	<ol>
{% for tag in tags %}

	<li>
		<dl>
		<dt><a href="/ideas/tags/{{ tag }}/">{{ tag }}</a></dt>
		<dd>Related to {{ tag.count }} ideas</dd>
		<dd class="date"></dd>
		</dl>
	</li>
{% endfor %}
	</ol>
</div>
{% endif %}

{% endblock %}